import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import Money from '../views/Money.vue'
import Labels from '../views/Labels.vue'
import Edit from '../views/Edit.vue'
import Statictics from '../views/Statictics.vue'
import Detail from '../views/Detail.vue'
import NotFound from '../views/NotFound.vue'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path:'/',
    redirect:'/money'//重定向，设置默认
  },
  {
    path: '/money',
    name: 'money',
    component: Money
  },
  {
    path: '/labels',
    name: 'labels',
    component:Labels
     },
  {
    path: '/labels/edit/:id',
    name: 'edit',
    component:Edit
     },
  {
    path: '/statictics',
    name: 'statictics',
    component: Statictics
  },
  {
    path: '/detail',
    name: 'detail',
    component: Detail
  },
  {
    path:'*',
    name:'notFound',
    component:NotFound
  }
]

const router = new VueRouter({
  routes
})

export default router
